package com.yx.changdao.common.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.yx.changdao.common.annotation.AutoFill;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;
import java.util.Date;

/**
 * 角色权限表
 *
 * @author zhangqi
 * @date 2019-11-06 11:21:05
 */
@TableName(SysRolePermission.TABLE_NAME)
public class SysRolePermission implements Serializable {
    private static final long serialVersionUID = 1L;

    public static final String TABLE_NAME = "sys_role_permission";

    /**
     * 角色ID
     */
    public static final String ROLE_ID = "role_id";
    /**
     * 权限ID
     */
    public static final String PERM_ID = "perm_id";
    /**
     * 创建时间
     */
    public static final String CREATE_TIME = "create_time";


    /**
     * 角色ID
     */
    @Length(min = 5, max = 32, message = "角色id只能在1~32位之间")
    @TableId(type = IdType.INPUT)
    private String roleId;
    /**
     * 权限ID
     */
    @Length(min = 1, max = 32, message = "权限ID只能在1~32位之间")
    @TableId(type = IdType.INPUT)
    private String permId;
    /**
     * 创建时间
     */
    @AutoFill
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getPermId() {
        return permId;
    }

    public void setPermId(String permId) {
        this.permId = permId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
